/*
 * @Author: WLang
 * @LastEditors: WLang
 * @Description: 
 * @Date: 2023-06-29 21:04:19
 * @LastEditTime: 2023-06-30 12:57:48
 * @FilePath: \myblog\src\store\modules\modal.js
 */
export default {
  namespaced: true,
  state: {
    isShow: false,
    type: ''
  },
  mutations: {
    CLOSE(state)
    {
      state.isShow = false;
    },
    OPEN(state)
    {
      state.isShow = true;
    },
    CHANGE_TYPE(state, payload)
    {
      state.type = payload.type;
    }
  },
  actions: {
    close ({commit}){
      commit('CLOSE')
    },
    open ({commit}, type) {
      commit('CHANGE_TYPE', {type})
      commit('OPEN')
    },
    confirm () {
      console.log('提交');
    }
  }
}